3.3 \(\int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx\)

Optimal. Leaf size=39 \[ -\frac {x}{a}-\frac {\tan ^3(x) (1-\csc (x))}{3 a}+\frac {\tan (x) (3-2 \csc (x))}{3 a} \]

[Out]

-x/a+1/3*(3-2*csc(x))*tan(x)/a-1/3*(1-csc(x))*tan(x)^3/a

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3888, 3882, 8} \[ -\frac {x}{a}-\frac {\tan ^3(x) (1-\csc (x))}{3 a}+\frac {\tan (x) (3-2 \csc (x))}{3 a} \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]^2/(a + a*Csc[x]),x]

[Out]

-(x/a) + ((3 - 2*Csc[x])*Tan[x])/(3*a) - ((1 - Csc[x])*Tan[x]^3)/(3*a)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3882

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> -Simp[((e*Cot[c
+ d*x])^(m + 1)*(a + b*Csc[c + d*x]))/(d*e*(m + 1)), x] - Dist[1/(e^2*(m + 1)), Int[(e*Cot[c + d*x])^(m + 2)*(
a*(m + 1) + b*(m + 2)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && LtQ[m, -1]

Rule 3888

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx &=\frac {\int (-a+a \csc (x)) \tan ^4(x) \, dx}{a^2}\\ &=-\frac {(1-\csc (x)) \tan ^3(x)}{3 a}+\frac {\int (3 a-2 a \csc (x)) \tan ^2(x) \, dx}{3 a^2}\\ &=\frac {(3-2 \csc (x)) \tan (x)}{3 a}-\frac {(1-\csc (x)) \tan ^3(x)}{3 a}+\frac {\int -3 a \, dx}{3 a^2}\\ &=-\frac {x}{a}+\frac {(3-2 \csc (x)) \tan (x)}{3 a}-\frac {(1-\csc (x)) \tan ^3(x)}{3 a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.11, size = 62, normalized size = 1.59 \[ -\frac {-2 \sin (x)+4 \cos (2 x)+(6 x-5) (\sin (x)+1) \cos (x)}{6 a \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right ) \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]^2/(a + a*Csc[x]),x]

[Out]

-1/6*(4*Cos[2*x] - 2*Sin[x] + (-5 + 6*x)*Cos[x]*(1 + Sin[x]))/(a*(Cos[x/2] - Sin[x/2])*(Cos[x/2] + Sin[x/2])^3
)

________________________________________________________________________________________

fricas [A]  time = 0.73, size = 38, normalized size = 0.97 \[ -\frac {3 \, x \cos \relax (x) + 4 \, \cos \relax (x)^{2} + {\left (3 \, x \cos \relax (x) - 1\right )} \sin \relax (x) - 2}{3 \, {\left (a \cos \relax (x) \sin \relax (x) + a \cos \relax (x)\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*csc(x)),x, algorithm="fricas")

[Out]

-1/3*(3*x*cos(x) + 4*cos(x)^2 + (3*x*cos(x) - 1)*sin(x) - 2)/(a*cos(x)*sin(x) + a*cos(x))

________________________________________________________________________________________

giac [A]  time = 0.31, size = 49, normalized size = 1.26 \[ -\frac {x}{a} - \frac {1}{2 \, a {\left (\tan \left (\frac {1}{2} \, x\right ) - 1\right )}} - \frac {9 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 24 \, \tan \left (\frac {1}{2} \, x\right ) + 11}{6 \, a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*csc(x)),x, algorithm="giac")

[Out]

-x/a - 1/2/(a*(tan(1/2*x) - 1)) - 1/6*(9*tan(1/2*x)^2 + 24*tan(1/2*x) + 11)/(a*(tan(1/2*x) + 1)^3)

________________________________________________________________________________________

maple [A]  time = 0.45, size = 64, normalized size = 1.64 \[ -\frac {1}{2 a \left (\tan \left (\frac {x}{2}\right )-1\right )}+\frac {2}{3 a \left (\tan \left (\frac {x}{2}\right )+1\right )^{3}}-\frac {1}{a \left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {3}{2 a \left (\tan \left (\frac {x}{2}\right )+1\right )}-\frac {2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^2/(a+a*csc(x)),x)

[Out]

-1/2/a/(tan(1/2*x)-1)+2/3/a/(tan(1/2*x)+1)^3-1/a/(tan(1/2*x)+1)^2-3/2/a/(tan(1/2*x)+1)-2/a*arctan(tan(1/2*x))

________________________________________________________________________________________

maxima [B]  time = 0.42, size = 94, normalized size = 2.41 \[ -\frac {2 \, {\left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - \frac {6 \, \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} - \frac {3 \, \sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} + 2\right )}}{3 \, {\left (a + \frac {2 \, a \sin \relax (x)}{\cos \relax (x) + 1} - \frac {2 \, a \sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} - \frac {a \sin \relax (x)^{4}}{{\left (\cos \relax (x) + 1\right )}^{4}}\right )}} - \frac {2 \, \arctan \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*csc(x)),x, algorithm="maxima")

[Out]

-2/3*(sin(x)/(cos(x) + 1) - 6*sin(x)^2/(cos(x) + 1)^2 - 3*sin(x)^3/(cos(x) + 1)^3 + 2)/(a + 2*a*sin(x)/(cos(x)
 + 1) - 2*a*sin(x)^3/(cos(x) + 1)^3 - a*sin(x)^4/(cos(x) + 1)^4) - 2*arctan(sin(x)/(cos(x) + 1))/a

________________________________________________________________________________________

mupad [B]  time = 0.29, size = 51, normalized size = 1.31 \[ \frac {-2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3-4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{3}+\frac {4}{3}}{a\,\left (\mathrm {tan}\left (\frac {x}{2}\right )-1\right )\,{\left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )}^3}-\frac {x}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^2/(a + a/sin(x)),x)

[Out]

((2*tan(x/2))/3 - 4*tan(x/2)^2 - 2*tan(x/2)^3 + 4/3)/(a*(tan(x/2) - 1)*(tan(x/2) + 1)^3) - x/a

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\tan ^{2}{\relax (x )}}{\csc {\relax (x )} + 1}\, dx}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)**2/(a+a*csc(x)),x)

[Out]

Integral(tan(x)**2/(csc(x) + 1), x)/a

________________________________________________________________________________________